<template>
  <div class="tapbar">
    <!-- 版心 -->
    <div class="wrap topbarwrap">
      <div class="left">欢迎来到叩丁狼积分商城</div>
      <ul class="right">
        <li>
          <img
            src="@/assets/img/userImg.f8bbec5e.png"
            alt=""
            width="22px"
          />用户名：游客
        </li>
        <li>我的积分：--</li>
        <li>获取积分</li>
        <li>叩丁狼官网</li>
        <li class="login-btn" @click="changeIsShowLoginModel(true)">登录</li>
      </ul>
    </div>
  </div>
</template>

<script>
import { mapMutations } from "vuex";
export default {
  name: "IntegralMallTopBar",

  methods: {
    ...mapMutations({
      // 方法名：模块名/方法名
      changeIsShowLoginModel: "showModel/changeIsShowLoginModel",
    }),
  },
};
</script>

// scoped 仅在当前页面起作用
<style lang="less" scoped>
.tapbar {
  // 给一个最小宽度，防止屏幕缩小，拖动滚动条，topbar的登陆旁边出现一片空白的bug
  min-width: 1200px;
  height: 40px;
  background: #242b39;
  line-height: 40px;
  font-size: 14px;
  font-weight: 300;
  color: #fffefe;
  .topbarwrap {
    display: flex;
    justify-content: space-between;
    text-align: center;
  }
  .right {
    li {
      float: left;
      margin-left: 20px;
      cursor: pointer;
      &.login-btn {
        width: 124px;
        background: #0a328e;
      }
      img {
        vertical-align: middle;
        border-radius: 50%;
        padding-right: 5px;
      }
    }
  }
}
</style>